home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 4 code / C++ Driver / iacDriver / iacDriver.make < prev    next >
Encoding:
Text File  |  1991-07-23  |  3.6 KB  |  89 lines  |  [TEXT/MPS ]

  1. #   File:       iacDriver.make
  2. #   Target:     iacDriver
  3. #   Sources:    iacDriver.cp
  4. #   Created:    Friday, July 7, 1990 3:24:05 PM
  5.  
  6.  
  7. # Include all your objects in the objects variable.  In this case, these are all the
  8. # c++ object files we'll be dealing with.
  9. CPOBJECTS =     DriverGlue.a.o    ∂
  10.                     TDriver.cp.o     ∂
  11.                     TMessage.cp.o     ∂
  12.                     DriverWrapper.cp.o    ∂
  13.                     iacGlobalNewDel.cp.o
  14.  
  15.  
  16. # include all the c object files we want to deal with.  In this case, it's only one
  17. # file, and that houses the code for our INIT.
  18. COBJECTS =         installDriver.c.o
  19.  
  20.  
  21. # Specify any options you want to pass to the compiler(s).  -b tells the compiler to
  22. # put strings in with the current segment, and not in the global data segment.
  23. CPlusOptions = -b -mf
  24. COptions = -b
  25.  
  26.      
  27.  
  28. # Compile the INIT.  Make the dependencies the INIT header, the INIT source, and the
  29. # makefile.
  30. installDriver.c.o ƒ iacDriver.make installDriver.c installDriver.h
  31.      C  -b installDriver.c
  32.  
  33. # Compile the TDriver object.  Usual dependencies.
  34. TDriver.cp.o ƒ iacDriver.make TDriver.cp TDriver.h
  35.      CPlus TDriver.cp  -o TDriver.cp.o {CPlusOptions}
  36.  
  37. # Compile the TMessage object.  Usual dependencies.
  38. TMessage.cp.o ƒ iacDriver.make TMessage.cp TMessage.h
  39.      CPlus TMessage.cp   -o TMessage.cp.o {CPlusOptions}
  40.      
  41. # Compile the extern "C" code.  Usual dependencies.
  42. DriverWrapper.cp.o    ƒ    iacDriver.make    DriverWrapper.cp DriverWrapper.h
  43.           CPlus DriverWrapper.cp -o DriverWrapper.cp.o {CPlusOptions}
  44.  
  45. # Compile the replacements for the global new/delete operators which CFront includes
  46. # whenever it calls a constructor.  Our only dependencies here are the makefile and the
  47. # code itself.
  48. iacGlobalNewDel.cp.o    ƒ    iacDriver.make    iacGlobalNewDel.cp
  49.           CPlus iacGlobalNewDel.cp -o iacGlobalNewDel.cp.o {CPlusOptions}
  50.  
  51. # Compile the assembly glue object.  Usual dependencies
  52. DriverGlue.a.o ƒ iacDriver.make DriverGlue.a DriverGlue.incl.a
  53.     asm -case obj DriverGlue.a
  54.  
  55.  
  56. # Link everything for the driver together.  -rt specifies the resource type.  
  57. # In this case, it's 'DRVR' with an ID of 75.  -m specifies which routine in the 
  58. # object files is the first one, so we tell it to look for the first one in the 
  59. # assembly file.  -sn renames the main segment to ".TimDriver".  -ra is pretty 
  60. # self-explanatory, except you have to specify which segment(s) get the resource 
  61. # attributes.  Note the only library I needed for this entire thing was Interface.o.
  62. iacDriver.DRVR ƒƒ iacDriver.make {CPOBJECTS}
  63.     Link -rt DRVR=75 -m HEADERDEF -sn "Main=.TimDriver" -c 'TSEN ' -t 'DRVR' ∂
  64.         -ra ".TimDriver"=resSysHeap,resLocked,resPreLoad ∂
  65.         {CPOBJECTS} ∂
  66.         "{Libraries}Interface.o" ∂
  67.         -o iacDriver.DRVR
  68.     
  69.     
  70. # Link everything for the INIT together.  Not much here.  Much of the same options get
  71. # passed to the INIT linking as to the DRVR linking.  Again, only Interface.o needed.
  72. installDriver ƒƒ installDriver.c.o iacDriver.make
  73.     Link -rt INIT=8483 -sn "Main=InitSeg" -c 'TSEN' -t 'INIT' -m MAIN ∂
  74.         -ra InitSeg=resSysHeap,resLocked,resPreLoad ∂
  75.         {COBJECTS} ∂
  76.         "{Libraries}"Interface.o ∂
  77.         -o installDriver
  78.  
  79.  
  80. # Finally, the entire file must be put together.  It consists of the DRVR, the INIT, 
  81. # and the 'sysz' resources.  The DRVR is in iacDriver.DRVR, the INIT in installDriver,
  82. # and the 'sysz' resource in iacDriver.r.  It's a pain in the butt to derez these 
  83. # things, but I couldn't find any other way for rez to combine resources from several
  84. # files into one output file.  All the output gets put into the file "iacDriver".
  85. # Notice the second two rez lines simply append their resources to the file (with the
  86. # -a option).
  87. iacDriver ƒƒ iacDriver.r iacDriver.DRVR installDriver
  88.     rez iacDriver.r -c TSEN -t INIT -a -o iacDriver
  89.